<template>
  <div id="basicLayout">
    <a-layout style="min-height: 100vh">
      <a-layout-header class="header">
        <GlobaHeader @show="open()" />
      </a-layout-header>
      <a-layout-content class="content">
        <router-view />
        <div class="editFrom">
          <EditUserInfo ref="editUserRef" />
        </div>
      </a-layout-content>
      <a-layout-footer class="footer"> Tin图库 by LinYH </a-layout-footer>
    </a-layout>
  </div>
</template>

<script setup lang="ts">
import GlobaHeader from '@/components/GlobaHeader.vue'
import EditUserInfo from '@/components/EditUserInfo.vue'
import { ref } from 'vue'


// 子组件引用
const editUserRef = ref<InstanceType<typeof EditUserInfo> | null>(null);
const open = () => {
  if (editUserRef.value) {
    // 调用子组件暴露的方法，并可传递参数
    editUserRef.value.childMethod();
  }
}

</script>

<style scoped>
#basicLayout .header {
  padding-inline: 20px;
  background: #fff;
  color: unset;
  margin-bottom: 16px;
}
#basicLayout .footer {
  background: #efefef;
  padding: 16px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
}

#basicLayout .content {
  padding: 30px;
  background: linear-gradient(to right, #fefefe, #fff);
  margin-bottom: 30px;
}
</style>
